import { musicRequest } from '@/utils/request';
import type { IPlaylistInformationParams, IPlaylistInformationInfo, ISongURL, ISongLyric } from './type';

enum API {
	// 请求歌单音乐
	playlistInformation = '/playlist/track/all',
	// 音乐播放url
	SongURL = '/song/url',
	// 音乐详情信息
	SongDetail = '/song/detail',
	// 歌词
	SongLyric = '/lyric',
}

export const usePlaylistInformation = (params: IPlaylistInformationParams) =>
	musicRequest.get<IPlaylistInformationInfo>(API.playlistInformation, params);
export const useSongURL = (id: number) => musicRequest.get<ISongURL>(API.SongURL, { id });
export const useSongDetail = (ids: number) => musicRequest.get(API.SongDetail, { ids });
export const useSongLyric = (id: number) => musicRequest.get<ISongLyric>(API.SongLyric, { id });
